package com.lh.flyweight;

public class Client {
    public static void main(String[] args) {

        //创建一个工厂类
        WebSiteFactory factory = new WebSiteFactory();

        //客户要以一个新闻形式发布的网站
        WebSite webSite = factory.getWebSiteCategory("新闻");

        webSite.use(new User("Bob"));


        //博客形式
        WebSite webSite1 = factory.getWebSiteCategory("博客");
        webSite1.use(new User("Tom"));


        int webSiteCount = factory.getWebSiteCount();
        System.out.println("网站类型有：" + webSiteCount + " 种");
    }
}
